
<!-- File: /app/View/Item/index.ctp -->

<h1>Itens</h1>

<?php 
                        if($isLoged)
                            if($isAdmin=="admin")
                            {
                                echo '<p><div class="boton"><div class="boton_content">';
                                echo $this->Html->link('Adicionar Item', array('action' => 'add'));
                                echo '</div></div></p>';
                            }
?>
<table>
    

	
	<div id="post_background">
		<?php foreach ($items as $item): ?>
			<div class="post">				
				<?php echo '<p>'.$this->Html->link($item['Item']['item_name'], array('action' => 'view', $item['Item']['id'])).'<p>';?>
                                
                                <?php 
                                        echo $this->Html->link($this->Html->image('../files/tmp_'.$item['Item'][0]['file_name'], 
                                        array("alt" => __('View'), "title" => __('View'),"width" => __('70'))),
                                        array('action' => 'view', $item['Item']['id']),
                                        array('escape' => false));
                                ?>
                              
                                <div class="descricao_item">
                                <?php
                                        echo '<p>'.$item['Item']['description'].'</p>';  
                                ?>
                                </div>
				</p>
				<p>
				
				<?php
				if ($isLoged){
					if($isAdmin=="admin"){
							
							echo $this->Html->link($this->Html->image('icons/ico/modify.ico',
                                                        array("alt" => __('Edit'), "title" => __('Edit'),"width" => __('15'))),
                                                        array('action' => 'edit', $item['Item']['id']),
                                                        array('escape' => false));
                                        
							
		
							echo $this->Form->postLink($this->Html->image('icons/ico/delete.ico',
                                                        array("alt" => __('Delete'), "title" => __('Delete'),"width" => __('15'))), 
                                                        array('action' => 'delete', $item['Item']['id']),
                                                        array('escape' => false),
							__('Você tem certeza?'));
								
					}
				}
				?>
                                
                                
			</div>
		<?php endforeach; ?>
	</div>

</table>